<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<%
String path = request.getContextPath();
if (path.equals("/")) {path = "";}
pageContext.setAttribute("path", path);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="${path }/css/web/signUp.css" rel="stylesheet" type="text/css" />
		<link rel="shortcut icon" type="image/x-icon" href="${path }/favicon.ico" >
		<title>在线报名</title>
		<link type="text/css" rel="stylesheet" href="${path}/js/formValidator/style/validator.css" />
		<script type="text/javascript" src="${path}/js/jquery/jquery-1.5.1.js"></script>
		<script type="text/javascript" src="${path}/js/formValidator/formValidator.min.js" charset="UTF-8"></script>
		<script type="text/javascript" src="${path}/js/formValidator/formValidatorRegex.js" charset="UTF-8"></script>
	    <script type="text/javascript">     
		$(function() {
			
			$.formValidator.initConfig(
                {formID:"uploadForm", submitOnce:true,
                onSuccess:function(){return true;},
                onError:function(msg,obj,errorlist){
                    //$.map(errorlist,function(msg1){alert(msg1)});
//                     alert(msg);
                }
            });
			
			$("#mobile").formValidator({onShowText:"请输入手机号", onShow:"方便我们与您联系",onFocus:"请输入正确格式的手机号",onCorrect:"　"})
					.inputValidator({min:11,max:11,onError:"手机号格式不正确"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"不是合法的手机号"})
	            	.ajaxValidator({
	                dataType : "html",
	                async : true,
	                url : "${path}/web_checkMobile",
	                success : function(data){
	                    if(data == "n") return true;
	                    if (data == "y") {
	                        alert("该手机号已注册");
	                        return false;
	                    }
	                    return false;
	                },
              buttons: $("#submitForm"),
              error: function(XMLHttpRequest, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
              onError : "该手机号不可用，请更换手机号",
              onWait : "正在对手机号进行验证，请稍候..."});

            
            $("#name").formValidator({onShowText:"请输入您的姓名", onShow:"请输入您的姓名",onFocus:"姓名长度1至18",onCorrect:"　"})
            			.inputValidator({min:1,max:11,onError:"姓名长度1至18"});
            
		});
	    </script>
	    
	 </head>
	<body>
<!-- 	    <div id ="header"> -->
<!-- 	        <div class="content"> -->
<!-- 	            <div class="logo png_bg"></div> -->
<%-- 	            <div class="menu"><a href="${path}/index.jsp">返回首页&gt;&gt;</a></div> --%>
<!-- 	        </div> -->
<!-- 	    </div> -->
	    <div id="main">
	        <div class="content">
	            <div class="apply">
	                <div class="title">
	                     <b>&nbsp;&nbsp;&nbsp;在线报名</b>
	                </div>
	                <s:if test="hasActionErrors()">
	                   <div class="line" style="height: 40px;border: 1px solid #f91;background-color: #ffd;font-style: italic;"><s:actionerror/> </div>
	                </s:if>
	                <div class="text">
						<form method="post" id="uploadForm" name="uploadForm" enctype="multipart/form-data" action="${path }/web_signUp">	
		                    <table id="tablea" class="tablea">
		                    
		                    	<tr><td class="left">手机<span class="require_tip">*</span>：</td>
		                          <td><input type="text" maxlength="40" id="mobile" name="emp.mobile" class="normaltxt"/></td>
		                          <td width="220"><div id="mobileTip"></div></td></tr>
		                        <tr><td height="25"></td></tr>
		                    
		                    	<tr><td class="left">姓名<span class="require_tip">*</span>：</td>
		                          <td><input type="text" maxlength="40" id="name" name="emp.name" class="normaltxt"/></td>
		                          <td width="220"><div id="nameTip"></div></td></tr>
		                    	<tr><td height="25"></td></tr>
		                    	
		                        <tr><td class="left">性别<span class="require_tip">*</span>：</td>
		                          <td><input type="radio" value="1" name="emp.sex" checked="checked" />男<input type="radio" value="0" name="emp.sex" />女</td>
		                          <td><div id="loginPasswordTip"></div></td></tr>
		                        <tr><td height="25"></td></tr>  
		                          
		                        <tr><td class="left"></td><td colspan="2"><div id="introTip"></div></td></tr>
		                        <tr><td class="left"></td><td colspan="2"><input type="submit" class="button1" id="submitForm" value="" />
		                        	<input type="reset" value="" class="button2" /></td></tr>
		                    </table>
						</form>
	                </div>
	            </div>
	        </div>
	    </div>	
	    <div class="botom"></div>
	</body>
</html>